local proto = {}
proto.c2s = [[
.package {
	type 0 :integer
	session 1: integer
	ud 2 : string
}

.roominfo {
	id 0: string
	name 1: string
	userid 2: string
}

.user {
	userid 0: string
	name 1: string
}

ping 1 {}

createroom 2 {
	request {
		name 0: string
		pass 1: string
	}
	response {
		ok   0: integer
		room 1: roominfo
	}
}

roomlist 3 {
	request {
		page  0: integer
	}
	response {
		ok   0: boolean
		room 1: *roominfo
	}
}

roomcommand 4 {
	request {
		id 0: string
		cmd 1: integer
	}
	response {
		ok 0 : integer
		user 1: *user
	}
}

playcommand 5 {
	request {
		cmd 0: integer
		index 1 : integer
		card 2: integer
	}
	response {
		ok 0 : integer
	}
}

handshake 6 {
	request {
		data 0 : string
	}
	response {
		ok 0 : boolean
	}
}

gameready 7 {
	response {
		ok 0 : integer
	}
}

takecard 8 {
	request {
		index 0 : integer
	}
	response {
		ok 0 : integer
		card 1 : integer
	}
}


roominfo 9 {
	response {
		ok 0 : integer
		room 1: roominfo
		cards 2: string
		master 3: string
		index 4: integer
		user 5: *user
		clock 6: integer
	}
}

hu 10 {
	request {
		index 0: integer
	}
	response {
		ok 0 : integer
	}
}

peng 11 {
	request {
		card 0: integer
		index 1 : integer
	}
	response {
		ok 0 : integer
	}
}
]]

proto.s2c = [[
.package {
	type 0 : integer
	session 1 : integer
	ud 2 : string
}

.roominfo {
	id 0: string
	name 1: string
	userid 2: string
}

.user {
	userid 0: string
	name 1: string
}


heartbeat 1 {}

onroom 2 {
	request {
		userid 0: string
		user 1: *user
		cmd 2: integer
	}
}

ongameready 3 {
	request {
		cards 0: string
		master 1: string
		index 2: integer
	}
}

onplay 4 {
	request {
		ok 0: integer
		card 1: integer
		peng 2: integer
		index 3: integer
	}
}

ongameover 5 {
	request {
		ok 0: integer
		userid 1: string
	}
}

oncardnum 6 {
	request {
		count 0: integer
	}
}

onnewroom 7 {
	request {
		room 0: *roominfo
	}
}

onaiplay 8 {
	request {
		card 1: integer
		index 2: integer
	}
}

onpeng 9 {
	request {
		index 0:integer
	}
}

waitpeng 10 {
	request {
		card 0:integer
		index 1:integer
	}
}
]]
return proto